import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MemberCenterHomeComponent } from './member-center-home/member-center-home.component';
import { ProjectDetailComponent } from './projectDetail/projectDetail';
import { ReportSubmitComponent } from './report/reportSubmit';
import { ProjectDetailActivate, MyBugsActivate, BugDetailActivate } from 'src/app/core/auth/auth.guard';
import { RedTeamComponent } from './redTeam/redTeam';
import { MyProjectComponent } from './myProject/myProject';
import { AboutUsComponent } from './aboutus/aboutus';
import { NoticeListComponent } from './notice/notice';
import { NoticeDelComponent } from './notice/noticeDel';
import { IndexComponent } from './index';
import { LoginComponent } from '../pages/login/login.component';
import { RegisterComponent } from '../pages/register/index.component';
import { MyCollectComponent } from './userCenter/my/myCollect';
import { UserCenterComponent } from './userCenter/userCenter';
import { PasswordResetComponent } from '../pages/password-reset';
import { JBXXComponent } from './userCenter/userInfo/jbxx';
import { SMRZComponent } from './userCenter/userInfo/smrz';
import { XGMMComponent } from './userCenter/userInfo/xgmm';
import { SZTXComponent } from './userCenter/userInfo/sztx';
import { MyOrderComponent } from './userCenter/my/myOrder';
import { MyReportComponent } from './userCenter/report/myReport';

const routes: Routes = [
    {
        path: '',
        children: [
            {
                path: '',
                redirectTo: 'home.index',
            },
            {
                path: 'home',
                component: MemberCenterHomeComponent,
                data: {
                    title: '工作台',
                    translate: 'member-center.home'
                },
                children: [{
                    path: 'index',
                    component: IndexComponent,
                    data: {
                        title: '首页',
                        translate: 'member-center.home.index'
                    }
                }, {

                    path: 'login',
                    component: LoginComponent,
                    data: {
                        title: '登录',
                        translate: 'member-center.home.login'
                    }
                }, {
                    path: 'password/reset',
                    component: PasswordResetComponent,
                    data: {
                        title: '重置密码',
                        translate: 'pages.password.reset'
                    }
                },{
                    path: 'myProject',
                    component: MyProjectComponent,
                    data: {
                        title: '我要检测',
                        translate: 'member-center.home.myProject'
                    }
                }, {
                    path: 'projectDetail',
                    component: ProjectDetailComponent,
                    data: {
                        title: '项目详情',
                        translate: 'member-center.home.projectDetail'
                    },
                    resolve: {
                        userDel: ProjectDetailActivate,
                    },
                }, {
                    path: 'queryList',
                    component: NoticeListComponent,
                    data: {
                        title: '查询列表',
                        translate: 'member-center.home.queryList'
                    }
                }, {
                    path: 'bzwx',
                    component: RedTeamComponent,
                    data: {
                        title: '标准文献',
                        translate: 'member-center.home.bzwx'
                    }
                },{
                    path: 'jcSubmit',
                    component: ReportSubmitComponent,
                    data: {
                        title: '创建检测申请单',
                        translate: 'member-center.home.jcSubmit'
                    }
                },{
                    path: 'register',
                    component: RegisterComponent,
                    data: {
                        title: '注册',
                        translate: 'member-center.home.register'

                    }
                },{
                    path: 'userCenter',
                    component: UserCenterComponent,
                    data: {
                        title: '个人中心',
                        translate: 'member-center.userCenter'
                    },
                    children:[
                        {
                            path: 'myReport',
                            component: MyReportComponent,
                            data: {
                                title: '我的报告',
                                translate: 'member-center.home.myReport'
    
                            }
                        },
                        {
                            path: 'myCollect',
                            component: MyCollectComponent,
                            data: {
                                title: '我的收藏',
                                translate: 'member-center.home.myCollect'
    
                            }
                        },
                        {
                            path: 'myOrder',
                            component: MyOrderComponent,
                            data: {
                                title: '我的订单',
                                translate: 'member-center.home.myCollect'
    
                            }
                        },
                        {
                            path: 'JBXX',
                            component: JBXXComponent,
                            data: {
                                title: '基本信息',
                                translate: 'member-center.home.my.jbxx'
        
                            }
                        },{
                            path: 'SMRZ',
                            component: SMRZComponent,
                            data: {
                                title: '实名认证',
                                translate: 'member-center.home.my.SMRZ'
        
                            }
                        },{
                            path: 'XGMM',
                            component: XGMMComponent,
                            data: {
                                title: '修改密码',
                                translate: 'member-center.home.my.XGMM'
        
                            }
                        },{
                            path: 'SZTX',
                            component: SZTXComponent,
                            data: {
                                title: '设置头像',
                                translate: 'member-center.home.my.SZTX'
        
                            }
                        }
                    ]
                }]
            },
            {
                path: 'reportSubmit',
                component: ReportSubmitComponent,
                data: {
                    title: '报告提交',
                    translate: 'member-center.reportSubmit'
                }
            },
           
           
            {
                path: 'myReport',
                component: MyReportComponent,
                data: {
                    title: '我的漏洞',
                    translate: 'member-center.myReport'
                },
                resolve: {
                    userDel: MyBugsActivate
                },
            },
            
            {
                path: 'aboutus',
                component: AboutUsComponent,
                data: {
                    title: '关于我们',
                    translate: 'member-center.aboutus',
                }
            },
            {
                path: 'noticeDel',
                component: NoticeDelComponent,
                data: {
                    title: '消息详情',
                    translate: 'member-center.noticeDel'
                }
            },
            {
                path: '**',
                redirectTo: 'home/index'
            },
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class MemberCenterRoutingModule { }
